import req from '@/utils/request'
const baseURL = process.env.VUE_APP_BASE_URL
// const baseURL = ''
export function getAssignments(data) {
    return req({
        method: 'get',
        url: baseURL + '/superlink/api/assignments/',
        params: data
    })
}
export function getAssignments2(data, deviceToken) {
    return req({
        method: 'get',
        url: baseURL + `/superlink/api/devices/${deviceToken}/assignments`,
        params: data
    })
}
export function getAssignmentsActive(data, deviceToken) {
    return req({
        method: 'get',
        url: baseURL + `/superlink/api/devices/${deviceToken}/assignments/active`,
        params: data
    })
}
export function getMeasurements(data, token) {
    return req({
        method: 'get',
        url: baseURL + "/superlink/api/assignments/" + token + "/measurements",
        params: data
    })
}
export function getAssignmentSearchList(data, urldata) {
    return req({
        method: 'post',
        url: baseURL + "/superlink/api/assignments/search?" + urldata,
        data
    })
}

export function activationAssignments(data, assignmentsToken) {
    return req({
        method: 'put',
        url: baseURL + "/superlink/api/assignments/" + assignmentsToken,
        data
    })
}
export function releaseAssignments(assignmentsToken, urlParam) {
    return req({
        method: 'post',
        url: baseURL + "/superlink/api/assignments/" + assignmentsToken + urlParam,
    })
}
export function getAssignmentsDetails(data, assignmentsToken) {
    return req({
        method: 'get',
        url: baseURL + '/superlink/api/assignments/' + assignmentsToken,
        params: data
    })
}